package org.jgs1904.service.impl;

import org.jgs1904.mapper.BooksMapper;
import org.jgs1904.pojo.Books;
import org.jgs1904.service.BookService;

import java.util.List;

/**
 * @author 墨苍璃
 * @date 2022年01月11日16时37分
 */
public class BookServiceImpl implements BookService {

    /**
     * 调用dao层的操作，设置一个set接口，方便Spring管理
     */
    private BooksMapper bookMapper;


    public void setBookMapper(BooksMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Books book) {
        return bookMapper.addBook(book);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

}
